Create a new region

This request creates a new region for a client's rides.

Request syntax

POST https://b2b-api.go.yandex.ru/integration/2.0/geo_restrictions/create
Deprecated
POST https://b2b-api.go.yandex.ru/integration/2.0/geo_restrictions

Request headers

  • Authorization: Bearer <OAuth-token>
    OAuth access token. The steps to get a token are described in Getting started.
  • X-YaTaxi-Selected-Corp-Client-Id — client ID from the account. Required if multiple clients are available using the token.

Request body

The data for the new region is transferred in the request body as a JSON file:

Field

Description

Format

Required

name

Name.

String

Yes

geo_type

Geo restriction type. Currently only circle is supported.

String

Yes

geo

Geo restriction description. Contains the following fields:

  • center: The coordinates of the center point.
  • radius: The distance from the center (in meters).

Object

Yes

Response field description

Responses may contain the following fields:

Field Description Format
id Ride region ID. String

Request example

POST https://b2b-api.go.yandex.ru/integration/2.0/geo_restrictions/create
  {
    "geo": {
      "center": [
        37.642639,
        55.734894
      ],
      "radius": 200
    },
    "geo_type": "circle",
    "name": "Office 2"
}

Response example

An example response to this request looks like this:

  {
      "id": "b45efcaa04014fff997c2683ef91f0de"
  }

Response codes

The response to this request may contain the following standard HTTP codes:

  • 200: Request completed successfully.
  • 400: An unknown parameter or a parameter with an invalid value was passed in the request. For example, a record with the specified data already exists.
  • 401: The OAuth token is incorrect.
  • 403: The client doesn't have sufficient rights to run this request.
    • SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header X-YaTaxi-Selected-Corp-Client-Id (returned if more than one client is available for the token).
    • SELECTED_CLIENT_ACCESS_DENIED: the header X-YaTaxi-Selected-Corp-Client-Id contains the client's ID, which this login does not have access to.